package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.Driver;
import com.xmtlxx.tms.domain.bo.DriverBo;
import com.xmtlxx.tms.domain.vo.DriverVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 司机Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface DriverMapper extends BaseMapperPlus<DriverMapper, Driver, DriverVo> {
    /**
     * 根据条件分页查询司机
     *
     * @param driver 司机
     * @return Page Driver
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "u.user_name"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "u.user_name")
    })
    Page<DriverVo> selectPageDriverList(@Param("page") Page<Driver> page,@Param("driver") DriverBo driver);

    /**
     * 查询司机列表
     *
     * @param driver 司机
     * @return 司机集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "d.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "d.create_by")
    })
    List<DriverVo> selectDriverList(@Param("driver") DriverBo driver);

    DriverVo selectDriverVoByID(String id);
}
